Component({

  externalClasses: ['v-panel'],

  properties: {
    isShow: {
      type: Boolean,
      value: false,
      observer: function (newVal, oldVal) {
        this.setData({
          keyBoardType:1
        })
        // 属性值变化时执行
      }
    },
    buttonBorder: {
      type: String,
      value: "1px solid #ccc"
    },
    backgroundColor: {
      type: String,
      value: "#fff"
    },
    //1为省份键盘，其它为英文键盘
    keyBoardType: {
      type: Number,
      value: 1,
    },
    inp:{
      type:String,
      value:"",
      observer: function (newVal, oldVal) {
        console.log(newVal)
        this.setData({
          oinp:newVal
        })
        // 属性值变化时执行
      }
    }
  },
  data: {
    keyVehicle1: ['陕','京','津','沪','冀','豫','云','辽'],
    keyVehicle2: ['黑','湘','皖','鲁','新','苏','浙','赣'],
    keyVehicle3: ['鄂','桂','甘','晋','蒙','吉','闽'],
    keyVehicle4: ['粤', '川', '青', '藏', '琼', '宁','贵','渝'],
    keyNumber: '1234567890',
    keyEnInput1: 'QWERTYUIOP',
    keyEnInput2: 'ASDFGHJKL',
    keyEnInput3: 'ZXCVBNM',
    oinp:""
  },
  methods: {
    vehicleTap: function (event) {
      let val = event.target.dataset.value;
      console.log(val)
      switch (val) {
        case 'delete':
          this.triggerEvent('delete');
          this.triggerEvent('inputchange');
          break;
        case 'ok':
          this.triggerEvent('ok');
          break;
        case 'exit':
          this.triggerEvent('exit');
          break;
        default:
          this.triggerEvent('inputchange', val);
      }
    },
    colse_da(){
      this.triggerEvent('exit2');
    },
    check(){
      
      if (this.data.keyBoardType==1){
        this.data.keyBoardType = 2
      }else if (this.data.keyBoardType == 2) {
        this.data.keyBoardType = 1
      }
      this.setData({
        keyBoardType: this.data.keyBoardType
      })
    },
  }
});